//
//  ZYCourseAttendanceTowModel.m
//  ZYManagementSystem
//
//  Created by Ethan on 2017/6/8.
//  Copyright © 2017年 乾坤. All rights reserved.
//

#import "ZYCourseAttendanceTowModel.h"

@implementation ZYCourseAttendanceTowModel


- (instancetype)init_ObjectForValue:(NSDictionary *)Dict
{
    self = [super init];
    if (self)
    {
        [self setValuesForKeysWithDictionary:Dict];
        self.Enable = YES;
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"owner"])
    {
        self.user_username = value[@"username"];
        self.user_petName  = value[@"petName"];
        self.user_ID       = value[@"uid"];
        self.avatar        = [value[@"avatar"] isKindOfClass:[NSNull class]] ? @"":value[@"avatar"];
    }
    else if ([key isEqualToString:@"id"])
    {
        self.enrollInfoId = value;
    }
    else
    {
        [super setValue:value forKey:key];
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"user"])
    {
        self.user_petName = value[@"petName"];
        self.user_username = value[@"username"];
        self.user_ID = value[@"uid"];
        self.avatar        = [value[@"avatar"] isKindOfClass:[NSNull class]] ? @"":value[@"avatar"];

    }

    if ([key isEqualToString:@"orderId"])
    {
        self.orderIds = [value stringValue];
    }
}



@end
